from wormbane.model.armor import Armor
from wormbane.model.mushroom import Mushroom
from wormbane.model.race import Race
from wormbane.model.weapon import Weapon
from wormbane.util.random_ import weighted_choice

import random

class Drow(Race):
    color = 'black'
    health = 2

    @classmethod
    def create_equipment(cls):
        def random_metal():
            return weighted_choice(octiron = 1, steel = 99)

        def random_fabric():
            return weighted_choice(cloth = 99, spider_silk = 1)

        yield Weapon(kind = random.choice(('dagger', 'knife', 'sword')),
                     material = random_metal())
        yield Armor(kind = 'cloak', material = random_fabric(),
                    color = 'black')
        yield Armor(material = 'leather', color = 'black')
        yield Armor(kind = 'shirt', material = random_metal())
        yield Mushroom()
